<!--
@description: 项目详情
@creationTime: 2025-04-15
-->

<route type="page" lang="json5">
{
  layout: 'default',
  style: {
    navigationBarTitleText: '项目详情'
  }
}
</route>

<template>
  <view class="py-2 bg-gray-50 min-h-screen box-border">
    <!-- 项目信息卡片 -->
    <wd-card>
      <view class="py-2">
        <view>
          <text class="text-gray-900 block mt-1 font-size-27rpx font-600">测试美团改造121212</text>
        </view>
        <view class="my-1">
          <text class="pr-4 text-gray-500">工程编号:</text>
          <text class="text-gray-700 font-500 font-size-25rpx">151515151515</text>
        </view>
        <view class="my-1">
          <text class="pr-4 text-gray-500">位置:</text>
          <text class="text-gray-700 font-500 font-size-25rpx">位置位置位置位置位置位置</text>
        </view>
      </view>
    </wd-card>

    <!-- 项目进度 -->
    <wd-card>
      <view class="py-2">
        <view>
          <text class="text-gray-900 block mt-1 mb-2 font-size-27rpx font-600">工程进度</text>
        </view>
        <wd-steps :active="active" align-center>
          <wd-step title="勘察" />
          <wd-step title="施工" />
          <wd-step title="调试" />
        </wd-steps>
      </view>
    </wd-card>

    <wd-card>
      <view class="py-2">
        <view>
          <text class="text-gray-900 block mt-1 font-size-27rpx font-600">基础信息</text>
        </view>
        <view class="my-1">
          <text class="pr-4 text-gray-500">中标单位:</text>
          <text class="text-gray-700 font-500 font-size-25rpx">苏州新智冷设备工程有限公司</text>
        </view>
        <view class="my-1">
          <text class="pr-4 text-gray-500">联系人:</text>
          <text class="text-gray-700 font-500 font-size-25rpx">张某某</text>
        </view>
        <view class="my-1">
          <text class="pr-4 text-gray-500">完工日期:</text>
          <text class="text-gray-700 font-500 font-size-25rpx">2025-12-10</text>
        </view>
      </view>
    </wd-card>

    <wd-card>
      <view>
        <wd-collapse v-model="value" accordion>
          <wd-collapse-item title="项目负责" name="item1" custom-class="px-1!">
            <wd-cell-group>
              <wd-cell title="张工" value="1666666666" />
            </wd-cell-group>
          </wd-collapse-item>
        </wd-collapse>
      </view>
    </wd-card>

    <wd-card>
      <wd-grid :column="4" :clickable="true">
        <wd-grid-item icon="picture" text="工单管理" link-type="navigateTo" url="/pages/ticket/index" />
        <wd-grid-item icon="picture" text="项目资料" />
        <!-- pages/construction-log/index -->
        <wd-grid-item icon="picture" text="日志" link-type="navigateTo" url="/pages/construction-log/index" />
        <wd-grid-item icon="picture" text="施工总览" />
      </wd-grid>
    </wd-card>
  </view>
</template>

<script lang="ts" setup>
import { ref } from 'vue'
const active = ref(0)
const value = ref([])
const docs = [
  { label: '项目资料', path: '/pages/project/docs' },
  { label: '施工日志', path: '/pages/project/logs' },
  { label: '施工记录', path: '/pages/project/records' },
  { label: '总览报表', path: '/pages/project/report' }
]

const handleCall = (phone: string) => {
  uni.makePhoneCall({ phoneNumber: phone })
}

const handleNavigate = () => {
  uni.openLocation({
    latitude: 31.298886, // 苏州虎丘区坐标
    longitude: 120.585316,
    name: '项目现场',
    address: '江苏省苏州市虎丘区青华路88号'
  })
}

const handleDoc = (path: string) => {
  uni.navigateTo({ url: path })
}
</script>

<style lang="scss"></style>
